<?php
namespace app\index\controller;

use service\DataService;
use think\Db;
use think\Controller;
/**
 * @desc 服务商产品
 * Class Valet
 * @package app\index\controller
 */
class Serverbus extends Controller
{
    public $table = 'ServerBusiness';

    public function createBusiness(){

        return view();
    }

    public function registerDo(){
        $datas = $this->request->post();
        $datas['create_time'] = date('Y-m-d H:i:s');

        $datas['name'] = '1';
        $datas['desc'] = '3';

        $company_id = DataService::save(Db::name($this->table), $datas, 'id', []);

        if($company_id){

            $data = [
                'code' => 200,
                'msg'   => '注册成功了！',
            ];
        }else{
            $data = [
                'code' => 0,
                'msg'   => '注册失败',
            ];
        }

        return json($data);

    }

    public function uploads(){
        return uploads();
    }

}
